#include "StringFilter.hpp"
#include <ctype.h>
#include <iostream>

namespace se
{

void erasePunct(std::string &s)
{
    std::string::iterator it = s.begin();
    while(it != s.end())
    {
        if(ispunct(*it))
            it = s.erase(it);
        else
            ++it;
    }
}

void stringToLower(std::string &s)
{
    for(std::string::iterator it = s.begin();
        it != s.end();
        ++it)
    {
        if(isupper(*it))
            *it = tolower(*it);
    }
}

bool isAllDigit(const std::string &s)
{
    for(std::string::const_iterator it = s.begin();
        it != s.end();
        ++it)
    {
        if(!isdigit(*it))
            return false;
    }
    return true;
}

} //namespace se

